#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
	int n,k;
	while(scanf("%d %d",&n,&k)!=EOF)
	{
		for(int i = 0;i<k;i++)
		{
			int t = n%10;
			if(!t) n = n/10;
			else n--;
		}
		printf("%d\n",n);
	}
}
